import http from '@/service/http'
import type * as T from '@/types/api/index'
import { decrypt, encrypt } from '@/utils/aes'
const VideoApi: T.IAblumList = {
  async list(data) {
    const res: any = await http.post('/admin/Video/list', data)
    res.data = JSON.parse(decrypt(res.data))
    return res
  },
  add(data) {
    data.name = encrypt(data.name)
    data.cover = encrypt(data.cover)
    data.source = encrypt(data.source)
    data.url = encrypt(data.url)
    return http.post('/admin/Video/add', data)
  },
  edit(data) {
    data.name = encrypt(data.name)
    data.cover = encrypt(data.cover)
    data.source = encrypt(data.source)
    data.url = encrypt(data.url)
    return http.post('/admin/Video/edit', data)
  },
  dels(data) {
    return http.post('/admin/Video/dels', data)
  }
}

export default VideoApi
